// 登录相关接口
import axios from '@/api/request/request'

// 分页获取文章信息
const getNewsPage = (option: any) => {
  return axios.post('/news/news/getNewsPage', {
    ...option
  })
}

// 新增信息
const insertNewsInfo = (option: any) => {
  return axios.post('/news/news/insertNewsInfo', {
    ...option
  })
}

// 根据id获取详细信息
const getNewsByCondition = (option: any) => {
  return axios.post('/news/news/getNewsByCondition', {
    ...option
  })
}

// 根据id更新信息
const updateNewsInfo = (option: any) => {
  return axios.post('/news/news/updateNewsInfo', {
    ...option
  })
}

// 切换文章状态（启用或停用）
const changeStatus = (option: any) => {
  return axios.post('/news/news/changeStatus', {
    ...option
  })
}

// 删除文章
const deleteNews = (option: any) => {
  return axios.post('/news/news/deleteNews', {
    ...option
  })
}

export { getNewsPage, insertNewsInfo, getNewsByCondition, updateNewsInfo, changeStatus, deleteNews }
